let BASE_URL = 'http://xxx:xxx'
BASE_URL = '/api';

export default (options => {
	uni.showLoading({
		title: '加载中...'
	})
	return new Promise((resolve, reject) => {
		uni.request({
			url: BASE_URL + options.url,
			method: options.method || 'GET',
			data: options.data || {},
			success(res) {
				if (res) {
					resolve(res)
				}
			},
			fail(err) {
				reject(err)
			},
			complete (){
				uni.hideLoading()
			}
		})
	})
})